package com.hopu.dy.controller;

import com.hopu.dy.pojo.FollowNotice;
import com.hopu.dy.service.IFollowNoticeService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/follownotices")
public class FollowNoticeController {

    @Resource
    private IFollowNoticeService followNoticeService;

    @PostMapping
    public void createFollowNotice(@RequestBody FollowNotice notice) {
        followNoticeService.createFollowNotice(notice);
    }

    @GetMapping
    public List<FollowNotice> getFollowNotices(@RequestParam Long followedUserId) {
        return followNoticeService.getFollowNotices(followedUserId);
    }
}